<%@page import="model.*"%>
<%@page import="Dao.*"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>相册</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<script type="text/javascript"
	src="image/bootstrap-3.0.3-dist/dist/js/jquery-2.1.1.min.js"></script>

<script type="text/javascript"
	src="image/bootstrap-3.0.3-dist/dist/js/bootstrap.min.js"></script>



<link href="image/bootstrap-3.0.3-dist/dist/css/bootstrap.css"
	rel="stylesheet" type="text/css">
<link href="image/bootstrap-3.0.3-dist/dist/css/bootstrap-theme.min.css"
	rel="stylesheet" type="text/css">
<link href="image/Flat-UI-master/css/flat-ui.css" rel="stylesheet"
	type="text/css">
<style>
#top {
	margin-top: 50px;
}

#bg1 {
	background: #ECF0F1;
}

#bg2 {
	background: #06F
}

#message {
	height: 900px;
	float: left;
}

#message2 {
	height: 900px;
	float: right;
}
</style>
</head>
<body class="padding-bottom: 70px;">
	<!-- 导航栏 -->

	<div class="navbar  navbar-inverse navbar-fixed-top " role="navigation">
		<div class=" col-md-1"></div>
		<div class=" col-md-2">
			<a href="index.jsp" class="navbar-brand">首页</a>
		</div>
		<div class=" col-md-2">
			<a href="messagelist.jsp" class="navbar-brand">文章</a>
		</div>
		<div class=" col-md-2">
			<a href="showalbum.jsp" class="navbar-brand">相册</a>
		</div>
		<div class=" col-md-2">
			<c:choose>
				<%-- <c:when test="${sessionScope.adminname.adminName eq 'cjm'}"> --%>
				<c:when test="${!empty sessionScope.adminname.adminName}">
					<a href="" class="navbar-brand">欢迎登录${sessionScope.adminname.adminName}</a>
				</c:when>
				<%-- <c:when test="${sessionScope.visitorname.visitorName eq '456'}"> --%>
				<c:when test="${!empty  sessionScope.visitorname.visitorName}">
					<a href="" class="navbar-brand">登录${sessionScope.visitorname.visitorName}</a>
				</c:when>
				<c:when test="${empty sessionScope.adminname.adminName }">
					<a href="login.jsp" class="navbar-brand">登录</a>
				</c:when>

			</c:choose>
		</div>
		<div class=" col-md-2">
			<c:choose>
				<%-- <c:when test="${sessionScope.adminname.adminName eq 'cjm'}"> --%>
				<c:when test="${!empty sessionScope.adminname.adminName}">
					<ul class="nav navbar-inverse">

						<li class="dropdown"><a class="dropdown-toggle navbar-brand"
							data-toggle="dropdown" href="#"> 后台&&退出<span class="caret"></span>
						</a>
							<ul class="dropdown-menu">
								<li><a href="manage.jsp"">进入后台</a></li>
								<li><a href="logout.action">退出系统</a></li>
							</ul></li>
					</ul>
				</c:when>
				<c:when test="${!empty  sessionScope.visitorname.visitorName}">
					<a href="logout2.action" class="navbar-brand">退出</a>
				</c:when>
			</c:choose>
		</div>
	</div>

	<%-- 	<%
		Admin admin = new Admin();
		AdminDao adminDao = new AdminDao();
		String name = "cjm";
		admin = adminDao.findByAdminnName(name);
		session.setAttribute("adminall", admin);
		System.out.println("已经执行");
	%> --%>

	<%-- 	<%
		AlbumDao albumDao = new AlbumDao();
		/*  Album album = new Album(); */
		List<Album> albumlist = new ArrayList<Album>();
		albumlist = albumDao.getallalbum();
		session.setAttribute("albumlist", albumlist);
		if (session.getAttribute("albumlist") != null) {
			List<Album> albumlist2 = new ArrayList<Album>();
			albumlist2 = (List) session.getAttribute("albumlist");
			System.out.println("获取路径：" + albumlist2.get(0).getPath());
		}
	%> --%>




	<div class="row" id="top">
		<div class="col-md-1"></div>
		<div class="col-md-2" id="bg1"
			style="height:900px; margin:20px auto auto 10px;">
			<div style=" width:180px; height:180px; margin-top:20px;">
				<img src="${sessionScope.adminall.adminPortrait}" width="180px"
					height="180px">
			</div>
			<div style="margin:10px;">
				<table>
					<tr>
						<td>姓名: ${sessionScope.adminall.adminName}</td>
					</tr>
					<tr>
						<td>手机:${sessionScope.adminall.adminPhone}</td>
					</tr>
					<tr>
						<td>emial:${sessionScope.adminall.adminEmail}</td>
					</tr>
					<tr>
						<td>web地址:${sessionScope.adminall.adminwebadd}</td>
					</tr>
				</table>
			</div>

			<c:choose>
				<c:when test="${!empty sessionScope.adminname.adminName}">


					<div>
						<form enctype="multipart/form-data" action="upalbum.action"
							method="post">
							<table>
								<tr>
									<td>上传照片</td>
								</tr>
								<tr>
									<td><input type="file" name="myFile" class="form-control"></td>
								</tr>
								<tr>
									<td><input type="submit" value="上传"></td>
								</tr>
							</table>
						</form>
					</div>
				</c:when>
			</c:choose>



			<div class="panel panel-default" style=" margin-top:100px;">
				<div class="panel-heading">标签列表</div>
				<div class="panel-body">

					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标签</li>
					<li class="fui-cmd">标表</li>

				</div>
			</div>

			<div>这里有一堆东西</div>
		</div>
		<div class="col-md-8" id="bg1"
			style="margin:20px auto auto 10px; height:900px;">
			<div style=" height:350px; width:600px; margin:20px 150px auto auto">

				<div id="myCarousel" class="carousel slide">
					<ol class="carousel-indicators">
						<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
						<li data-target="#myCarousel" data-slide-to="1"></li>
						<li data-target="#myCarousel" data-slide-to="2"></li>
						<li data-target="#myCarousel" data-slide-to="3"></li>
						<li data-target="#myCarousel" data-slide-to="4"></li>


					</ol>
					<div class="carousel-inner">

						<c:forEach var="album" items="${sessionScope.albumlist}" end="0">
							<div class="item active">
								<img src="${album.path}" style="width:600px; height:350px;">
							</div>

						</c:forEach>
						<c:forEach var="album" items="${sessionScope.albumlist}" begin="1"
							end="4">
							<div class="item">
								<img src="${album.path}" style="width:600px; height:350px;">
							</div>

						</c:forEach>



					</div>
					<!-- <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
                <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a> -->
					<a class="left carousel-control" href="#myCarousel"
						data-slide="prev"><span
						class="glyphicon glyphicon-chevron-left"></span></a> <a
						class="right carousel-control" href="#myCarousel"
						data-slide="next"><span
						class="glyphicon glyphicon-chevron-right"></span></a>


				</div>
			</div>

			<!-- 展示照片 -->
			<div style=" margin:20px 10px auto auto ">

				<c:forEach var="album" items="${sessionScope.albumlist}">

					<a href="./servlet/showphoto?albumid=${album.albumId}"> <img
						src="${album.path}"
						style=" width:100px; height:100px; margin:10px 10px 10px 10px;">
					</a>

				</c:forEach>

			</div>

		</div>

	</div>

	<div class="row">

		<div class="col-md-1"></div>
		<div class="col-md-10">@blackjm</div>

	</div>
</body>
</html>
